﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TuyennvLibrary.Notify.Winphone
{
    public class WinphoneNotifyResponse : NotifyResponse
    {
        public string NotifyStatus { get; set; }
        public string ConnectionStatus { get; set; }
        public string ChannelStatus { get; set; }
        public string Error { get; set; }
        public WinphoneNotifyResponse()
            : base()
        {
            NotifyStatus = ConnectionStatus = ChannelStatus = Error = string.Empty;
        }
        public WinphoneNotifyResponse CheckResponse()
        {
            if (NotifyStatus == "Received")
            {
                this.AddSuccess(1);

            }
            else if (!string.IsNullOrEmpty(NotifyStatus))
            {
                this.AddFailure(1);
            }
            return this;
        }
        public WinphoneNotifyResponse Fail()
        {
            NotifyStatus = "Fail";
            ConnectionStatus = "Fail";
            ChannelStatus = "Fail";
            this.AddFailure(1);
            return this;
        }
        public WinphoneNotifyResponse Fail(string Error)
        {
            Fail();
            this.Error = Error;
            return this;
        }
    }
}
